<template>
  <div class="jobmore ct">
      <el-breadcrumb class="head-nav" :separator-icon="ArrowRight">
        <el-breadcrumb-item :to="{ path: '/yardhome', query: {yardId:id}  }">站院首页</el-breadcrumb-item>
        <el-breadcrumb-item >驻站专家</el-breadcrumb-item>
        </el-breadcrumb>
      <div class="item-content">
        <div class="s-bottom">
            <div class="b-item" @click="to(item.professorId)" v-for="item in specList.list">
              <img :src="item.photo" alt="">
              <div class="item-info">
                <div class="info-name">{{ item.name }}</div>
                <div class="info-t oo">{{ item.workUnit }}</div>
                <div class="info-t ooo">{{ item.courtyardName || '' }}</div>
              </div>
            </div>
        </div>
        <div class="item-page">
          <el-pagination 
          v-model:current-page="specList.page" 
          :page-size="15"
            layout="prev, pager, next, jumper" prev-text="上一页" 
            next-text="下一页" :total="specList.total"
            @current-change="getPageCourtyardMien" />
        </div>
      </div>
  </div>
</template>
<script setup>
import { ref, computed, reactive } from 'vue';
import { useRouter } from 'vue-router';
import { pageProfessor } from '@/api/home';


const specList = reactive({
    list: [],
    total: 0,
    page: 1,
  });
const id = computed(() => router?.currentRoute?.value?.query.yardId)

  const router = useRouter();
  const to = (id1) => {
    router.push(`/yardspecialistdetail/${id1}?yardId=${id.value}`)
  }


  const getPageCourtyardMien = async(pageNum=1) => {
    const params = {
      params: {
        status: true,
        courtyardId: id.value
      },
      page: {
        pageSize: 15,
        pageNum,
      }
    }
    const ret = await pageProfessor(params)
    specList.list = ret?.data?.list || [];
    specList.total = ret?.data?.total;
    specList.page = pageNum;
  }
  getPageCourtyardMien();

</script>
<style lang="scss" scoped>
.jobmore {
  flex: 1;
  width: 100%;
  padding: 0 10%;
  color: #777;
  background: url('../../assets/xiaoyuan/4.jpeg') no-repeat center center / cover;

  .head-nav {
      display: flex;
      align-items: center;
      font-size: 24px;
      padding: 40px 0 30px;
    }
    .s-bottom {
      width: 100%;
      height: 900px;
      
      .b-item {
        display: inline-flex;
        height: 215px;
        width: 480px;
        margin-bottom: 50px;
        background-color: #fff;
        margin-right: 32px;

        cursor: pointer;
        img {
          // width: 170px;
          height: 100%;
          object-fit: contain;
        }
        .item-info {
          height: 100%;
          flex: 1;
          overflow: hidden;
          padding: 20px;
          font-size: 16px;
          .info-name {
            font-size: 30px;
            font-weight: bold;
            color: #000;
            margin-bottom: 15px;
          }
          .info-t {
            margin-bottom: 10px;
          }
        }
      }
    }
    .item-page {
      height: 160px;
      display: flex;
      align-items: center;
      justify-content: center;
      :deep(.el-pagination) {
        button, li {
          background-color: transparent;
          width: 50px;
          height: 50px;
          border: 2px solid #e5e5e5;
          border-radius: 5px;
          color: #777;
          font-size: 24px;
          font-weight: normal;
          margin-right: 30px;
        }
        button {
          border: 0 none;
        }
        .el-pagination__jump {
          color: #777;
          font-size: 26px;
        }
        .el-pagination__editor {
          min-width: 50px;
          min-height: 50px;
          font-size: 24px;
        }
        .el-input__wrapper {
          padding: 0;
        }
        .el-input__inner {
          color: #777 !important;
        }
      }
    }

}
</style>